package com.demo.blog;

import com.jfinal.aop.Inject;
import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Db;

public class FormerController extends Controller{
	FormerService service;
	
	/**
	 * 	前台查询方法
	 */
	public void queryData() {
//		setAttr("Bloggers", service.queryBloggers());
//		setAttr("Title", service.queryTitle());
		String sql ="select * from user";
		setAttr("Bloggers", Db.find(sql));
		String sql1 ="select * from content order by addTime desc";
		setAttr("Title", Db.find(sql1));
		String sql2 ="select * from thebottomlink";
		setAttr("thebottomlink", Db.find(sql2));
		renderJson();
	}
}
